package com.linzm.behavioraltype.observer07.observer;

import com.linzm.behavioraltype.observer07.Subject;

/**
 * @Author zimingl
 * @Date 2023/4/16 13:17
 * @Description: HexaObserver
 */
public class HexaObserver extends Observer {
    public HexaObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Hex String: "
                + Integer.toHexString(subject.getState()).toUpperCase());
    }
}
